/*
REPLICATION FOR EMPIRICAL RESULTS IN CHAUREY, CHIPLUNKAR, AND SOUNDARARAJAN

 STATA:  D:\Dropbox\Software\Stata 16\
    BASE:  D:\Dropbox\Software\Stata 16\ado\base\
    SITE:  D:\Dropbox\Software\Stata 16\ado\site\
    PLUS:  C:\Users\chiplunkarg\ado\plus\
PERSONAL:  C:\Users\chiplunkarg\ado\personal\
OLDPLACE:  c:\ado\

********************************************************************************
*/

clear
clear matrix
clear mata
set scheme modern

*************************************
* SET PATH HERE FOR MAIN FOLDER
*************************************
global path "/Users/chiplunkarg/Library/CloudStorage/Dropbox/APcontract_reducedform/JPE micro replication folder"

global code "$path/code"
global data "$path/data"
global est "$path/estimation"
global output "$path/output"
STP

*Install packages to run
sysdir set PERSONAL "$path/ado"
sysdir set PLUS "$path/ado"

ssc install winsor2, replace
ssc install reghdfe, replace
ssc install ftools, replace
ssc install estout, replace 
ssc install coefplot, replace 
ssc install synth, replace 
ssc install gtools, replace 
ssc install sg97_5, replace //format table
ssc install cdfplot, replace
net install scheme-modern, from("https://raw.githubusercontent.com/mdroste/stata-scheme-modern/master/") replace 


************************
* ASI REGRESSIONS
************************
do "$code/global_des.do"

************************
* ASI REGRESSIONS
************************
do "$code/ASI_regressions_main.do"
do "$code/ASI_regressions_synth.do" // Table A6
do "$code/ASI_eventstudy_long.do" // Figure A3

************************
* NSS REGRESSIONS
************************
do "$code/nss_regressions.do"
do "$code/nss_regressions_lfp.do" // Table A13
do "$code/nss_occdist.do" // Figure C1


************************
* EC REGRESSIONS
************************
do "$code/ec_firm_regs.do" // Tables 5, A14, and A15
do "$code/ec_sumstats.do" // Figure A2







************************
* ESTIMATION CODE
************************
do "$code/calibration/analysis.do" // Table 7
do "$code/calibration/lcorrelation.do" // Figure A4 and Table A16
do "$code/calibration/modelfit.do" // Table A17
do "$code/calibration/derivatives.do" // Table A18














